
// ****************************************************************************
//
// Logic 2: First room
//
// ****************************************************************************

#include "defines.txt"

if (new_room) {
  load.pic(room_no);
  draw.pic(room_no);
  discard.pic(room_no);
  set.horizon(50);


if(!has("mail"))
{
animate.obj(o1);
load.view(4);
set.view(o1,4);
set.loop(o1,0);
set.cel(o1,0);
position(o1,132,63);
set.priority(o1,6);
ignore.objs(o1);
stop.cycling(o1);
draw(o1);
}

if(!has("fish"))
{
animate.obj(o2);
load.view(8);
set.view(o2,8);
position(o2,100,100);
set.priority(o2,6);
ignore.objs(o2);
draw(o2);
}
// The next 6 lines need only be in the first room of the game
  if ((prev_room_no == 1 ||    // just come from intro screen
      prev_room_no == 0)) {    // or just started game
    position(o0,60,127);
    status.line.on();
    accept.input();
  }
    // Check what room the player came from and position them on the
// screen accordingly here, e.g:
// if (prev_room_no == 3) {
//   position(ego,158,128);
// }

  draw(o0);
  show.pic();
}

if (said("look")) {
  print("There is a pond, a jumping fish, a mailbox, and some overbrush.");
}

if (said("climb", "tree")) {
    print("You don't need to climb it!");
}

if (ego_edge_code == horizon_edge) {  // ego touching horizon
  new.room(2);
}

if (ego_edge_code == right_edge) {    // ego touching right edge of screen
  new.room(3);
}

if (ego_edge_code == bottom_edge) {   // ego touching bottom edge of screen
  new.room(2);
}

if (ego_edge_code == left_edge) {     // ego touching left edge of screen
  new.room(2);
}


    if (said("get","mail")) {
      if (posn(o0,125,77,140,88)) {
        if (!has("mail")) {
          get("mail");
          load.sound(62);
          sound(62,f16);
          erase(o1);
          print("You take the mail.");
          v3 += 3;
        }
        else {
          print("You already have it.");
        }
      }
      else {
        print("Get closer.");
      }
    }
    if (said("get","fish")) {
      if (posn(o0,85,84,117,110)) {
        if (!has("fish")) {
          get("fish");
          load.sound(30);
          sound(30,f16);
          erase(o2);
          print("You catch the jumping fish.");
          v3 += 3;
        }
        else {
          print("You already have it.");
        }
      }
      else {
        print("Get closer.");
      }
    }
    if (said("look", "mailbox")) {
    if (posn(o0,125,77,140,88)) {
       print("You see a letter, or is that just your eyes "
              "playing tricks with you?!?!");
    }
    else {
      print("There is nothing in it,"
            " or else you just can't tell from here!");
          }
         }
return();